import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/home/Home.vue'
import noticeList from './views/home/notice.vue'
import noticedes from './views/home/notice-des.vue'
import Index from './views/main'
import Study from '@/views/study'
import Teaching from '@/views/teaching'
import TeachingList from '@/views/teaching/teaching-list.vue'
import TeachingLook from '@/views/teaching/teaching-look.vue'
import Summary from '@/views/summary'
import center from '@/views/center'
import activity from '@/views/activity'
import activityAdd from '@/views/activity/add-activity.vue'
import activityDes from '@/views/activity/des-activity.vue'
import login from '@/views/login.vue'
import StudyDetails from '@/views/study/details.vue' 
import TeachingAdd from '@/views/teaching/teaching-add.vue'
import CenterAdd from '@/views/center/add-center.vue'
import CenterDes from "@/views/center/center-des.vue";
import centerList from '@/views/center/center-list.vue'
import Login from '@/views/login.vue'
import SummaryAdd from '@/views/summary/add-summary.vue'
import SummaryDes from '@/views/summary/des-summary.vue'
Vue.use(Router)

export default new Router({
  base: process.env.BASE_URL,
  routes: [
    {
      path:'*',
      redirect:'/'
    },
    {
      path:'/login',
      name:'login',
      component:Login,
      meta:{
        notoken:true
      }
    },
    {
      path: '/',
      name: 'Index',
      component: Index,
      redirect:'/home',
      children:[
        {
          path:'/home',
          name:'home',
          component:Home
        },
        {
          path:'/home/notice-list',
          name:'noticeList',
          component:noticeList,
        },
        {// 添加教学计划
          path:'/home/notice-des',
          name:'noticedes',
          component:noticedes
        },
        {
          path:'/study',
          name:'study',
          component:Study
        },
        {
          path:'/studyDetails',
          name:'studyDetails',
          component:StudyDetails
        },
        {
          path:'/teaching',
          name:'teaching',
          component:Teaching,
          redirect:'/teaching/teaching-list',
          children:[
            {
              path:'/teaching/teaching-list',
              name:'teachingList',
              component:TeachingList,
            },
            {// 添加教学计划
              path:'/teaching/teachingAdd',
              name:'teachingAdd',
              component:TeachingAdd
            },
            {// 查看教学计划
              path:'/teaching/teachingLook',
              name:'teachingLook',
              component:TeachingLook
            },
          ]
        },
        {
          path:'/summary',
          name:'summary',
          component:Summary
        },
        {
          path:'/summaryAdd',
          name:'summaryAdd',
          component:SummaryAdd
        },
        {
          path:'/summarydes',
          name:'summarydes',
          component:SummaryDes
        },
        {
          path:'/pinggu',
          name:'pinggu',
          component:() => import('./views/pg/index.vue')
        },
        {
          path:'/ziyuan',
          name:'ziyuan',
          component:() => import('./views/zy/index.vue')
        },
        // {
        //   path:'/activity',
        //   name:'activity',
        //   component:center,
        //   redirect:'/activity/activity-list',
        //   children:[
        //     {
        //       path:'/activity/activity-list',
        //       name:'activityList',
        //       component:activity,
        //     },
        //     {// 添加活动
        //       path:'/activity/activity-add',
        //       name:'activityAdd',
        //       component:activityAdd
        //     },
        //     {// 
        //       path:'/activity/activity-des',
        //       name:'activityDes',
        //       component:activityDes
        //     }
        //   ]
        // },
        {
          path:'/center',
          name:'center',
          component:center,
          redirect:'/center/center-list',
          children:[
            {
              path:'/center/center-list',
              name:'centerList',
              component:centerList,
            },
            {// 添加教学计划
              path:'/center/centerAdd',
              name:'centerAdd',
              component:CenterAdd
            },
            {// 添加教学计划
              path:'/center/center-des',
              name:'center-des',
              component:CenterDes
            }
          ]
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: login
    }
  ]
})
